<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
<title>Creating a game</title>
<style type="text/css">

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 5951 2009-05-18 18:03:10Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.

See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/

/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
  border: 0 }

table.borderless td, table.borderless th {
  /* Override padding for "table.docutils td" with "! important".
     The right padding separates the table cells. */
  padding: 0 0.5em 0 0 ! important }

.first {
  /* Override more specific margin styles with "! important". */
  margin-top: 0 ! important }

.last, .with-subtitle {
  margin-bottom: 0 ! important }

.hidden {
  display: none }

a.toc-backref {
  text-decoration: none ;
  color: black }

blockquote.epigraph {
  margin: 2em 5em ; }

dl.docutils dd {
  margin-bottom: 0.5em }

/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
  font-weight: bold }
*/

div.abstract {
  margin: 2em 5em }

div.abstract p.topic-title {
  font-weight: bold ;
  text-align: center }

div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
  margin: 2em ;
  border: medium outset ;
  padding: 1em }

div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
  font-weight: bold ;
  font-family: sans-serif }

div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title {
  color: red ;
  font-weight: bold ;
  font-family: sans-serif }

/* Uncomment (and remove this text!) to get reduced vertical space in
   compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
  margin-bottom: 0.5em }

div.compound .compound-last, div.compound .compound-middle {
  margin-top: 0.5em }
*/

div.dedication {
  margin: 2em 5em ;
  text-align: center ;
  font-style: italic }

div.dedication p.topic-title {
  font-weight: bold ;
  font-style: normal }

div.figure {
  margin-left: 2em ;
  margin-right: 2em }

div.footer, div.header {
  clear: both;
  font-size: smaller }

div.line-block {
  display: block ;
  margin-top: 1em ;
  margin-bottom: 1em }

div.line-block div.line-block {
  margin-top: 0 ;
  margin-bottom: 0 ;
  margin-left: 1.5em }

div.sidebar {
  margin: 0 0 0.5em 1em ;
  border: medium outset ;
  padding: 1em ;
  background-color: #ffffee ;
  width: 40% ;
  float: right ;
  clear: right }

div.sidebar p.rubric {
  font-family: sans-serif ;
  font-size: medium }

div.system-messages {
  margin: 5em }

div.system-messages h1 {
  color: red }

div.system-message {
  border: medium outset ;
  padding: 1em }

div.system-message p.system-message-title {
  color: red ;
  font-weight: bold }

div.topic {
  margin: 2em }

h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
  margin-top: 0.4em }

h1.title {
  text-align: center }

h2.subtitle {
  text-align: center }

hr.docutils {
  width: 75% }

img.align-left, .figure.align-left{
  clear: left ;
  float: left ;
  margin-right: 1em }

img.align-right, .figure.align-right {
  clear: right ;
  float: right ;
  margin-left: 1em }

.align-left {
  text-align: left }

.align-center {
  clear: both ;
  text-align: center }

.align-right {
  text-align: right }

/* reset inner alignment in figures */
div.align-right {
  text-align: left }

/* div.align-center * { */
/*   text-align: left } */

ol.simple, ul.simple {
  margin-bottom: 1em }

ol.arabic {
  list-style: decimal }

ol.loweralpha {
  list-style: lower-alpha }

ol.upperalpha {
  list-style: upper-alpha }

ol.lowerroman {
  list-style: lower-roman }

ol.upperroman {
  list-style: upper-roman }

p.attribution {
  text-align: right ;
  margin-left: 50% }

p.caption {
  font-style: italic }

p.credits {
  font-style: italic ;
  font-size: smaller }

p.label {
  white-space: nowrap }

p.rubric {
  font-weight: bold ;
  font-size: larger ;
  color: maroon ;
  text-align: center }

p.sidebar-title {
  font-family: sans-serif ;
  font-weight: bold ;
  font-size: larger }

p.sidebar-subtitle {
  font-family: sans-serif ;
  font-weight: bold }

p.topic-title {
  font-weight: bold }

pre.address {
  margin-bottom: 0 ;
  margin-top: 0 ;
  font: inherit }

pre.literal-block, pre.doctest-block {
  margin-left: 2em ;
  margin-right: 2em }

span.classifier {
  font-family: sans-serif ;
  font-style: oblique }

span.classifier-delimiter {
  font-family: sans-serif ;
  font-weight: bold }

span.interpreted {
  font-family: sans-serif }

span.option {
  white-space: nowrap }

span.pre {
  white-space: pre }

span.problematic {
  color: red }

span.section-subtitle {
  /* font-size relative to parent (h1..h6 element) */
  font-size: 80% }

table.citation {
  border-left: solid 1px gray;
  margin-left: 1px }

table.docinfo {
  margin: 2em 4em }

table.docutils {
  margin-top: 0.5em ;
  margin-bottom: 0.5em }

table.footnote {
  border-left: solid 1px black;
  margin-left: 1px }

table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
  padding-left: 0.5em ;
  padding-right: 0.5em ;
  vertical-align: top }

table.docutils th.field-name, table.docinfo th.docinfo-name {
  font-weight: bold ;
  text-align: left ;
  white-space: nowrap ;
  padding-left: 0 }

h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
  font-size: 100% }

ul.auto-toc {
  list-style-type: none }

</style>
</head>
<body>
<div class="document" id="creating-a-game">
<h1 class="title">Creating a game</h1>

<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#steps-to-create-a-game" id="id1">Steps to create a game</a><ul>
<li><a class="reference internal" href="#load-a-map" id="id2">Load a map</a></li>
<li><a class="reference internal" href="#save-the-game" id="id3">Save the game</a></li>
<li><a class="reference internal" href="#defining-areas" id="id4">Defining areas</a></li>
<li><a class="reference internal" href="#neighbouring-areas" id="id5">Neighbouring areas</a></li>
<li><a class="reference internal" href="#fine-adjustments-to-polygons" id="id6">Fine adjustments to polygons</a></li>
<li><a class="reference internal" href="#defining-unit-types" id="id7">Defining unit types</a></li>
<li><a class="reference internal" href="#updating-unit-types" id="id8">Updating unit types</a></li>
<li><a class="reference internal" href="#deleting-unit-types" id="id9">Deleting unit types</a></li>
</ul>
</li>
<li><a class="reference internal" href="#what-is-in-a-game" id="id10">What is in a game?</a><ul>
<li><a class="reference internal" href="#the-map" id="id11">The map</a></li>
<li><a class="reference internal" href="#areas" id="id12">Areas</a></li>
<li><a class="reference internal" href="#unit-types" id="id13">Unit types</a></li>
<li><a class="reference internal" href="#units" id="id14">Units</a></li>
<li><a class="reference internal" href="#colours" id="id15">Colours</a></li>
<li><a class="reference internal" href="#players" id="id16">Players</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="steps-to-create-a-game">
<h1><a class="toc-backref" href="#id1">Steps to create a game</a></h1>
<div class="section" id="load-a-map">
<h2><a class="toc-backref" href="#id2">Load a map</a></h2>
<p>The first step in creating a game is to load a map. You can use any GIF file as
a map.</p>
<p>Click menu <em>Edit-Load map</em> to load a map. A dialog window is displayed that
allows you to find the GIF file on your system.</p>
<p>Once the map is loaded, it is displayed on Greator:</p>
<img alt="../images/map_loaded.gif" src="../images/map_loaded.gif" />
<p>The map displayed here is <em>manual/images/map.gif</em>. It represents &quot;The
Horn of Africa&quot; and was created as an add-on to (a variant of) the A&amp;A
Europe game.</p>
</div>
<div class="section" id="save-the-game">
<h2><a class="toc-backref" href="#id3">Save the game</a></h2>
<p>Now that we have loaded a map, the game has some real contents and
this means it is time to save the game. Greator has not been fully
tested and therefore it is wise to save often.</p>
<p>Click menu <em>Game-Save game</em>. A dialog window is displayed that allows
you to define the location (directory) and name of the game file.</p>
<p>We have called the game &quot;demogame.zip&quot;. You can use any name you
like. However, game files are <em>.zip</em> files. Therefore, it is best to
use the <em>.zip</em> extension.</p>
<p>After the game has been saved, you'll see the title bar of the main
Greator window is updated with the file name. In our case, the title
bar now shows <em>/absolute/path/to/greator/games/demogame.zip</em> (The path
<em>/absolute/path/to/greator/</em> is, of course, dependent on where you
installed Greator.)</p>
</div>
<div class="section" id="defining-areas">
<h2><a class="toc-backref" href="#id4">Defining areas</a></h2>
<p>To define areas, you switch to Greator's <em>Area Editor</em>. This can be
done by clicking menu <em>Edit - Edit areas</em> or by the keyboard shortcut
<em>C-a</em> (Control-a). The panel to the left of the map, will now show the
text &quot;Editing areas&quot;.</p>
<p>Defining an area means drawing a polygon that is, more or less, equal
to the borders of the area on the map. The following figure shows a
polygon that defines the circle-area at the northern end of the Suez
canal. The area is called <em>Cairo</em>:</p>
<div class="figure" id="defining-cairo">
<img alt="../images/define_area3.gif" src="../images/define_area3.gif" />
<p class="caption">Defining Cairo</p>
</div>
<p>The polygon is yellow and one of its points is highlighted. We'll come
back to this highlighted point in Section <a class="reference internal" href="#fine-adjustments-to-polygons">Fine adjustments to
polygons</a>.</p>
<p>We'll now go through the steps we took to define the <em>Cairo</em> area.</p>
<p>The first step is, as mentioned, to switch to the <em>Area Editor</em>. Also,
we scrolled the map such that <em>Cairo</em>'s location became visible.</p>
<p>The next step is to one-by-one define the polygon points. Polygon
points are defined by <em>right-clicking</em> the mouse at the correct place
on the map. The first <em>right-click</em> defines the first polygon point
and the following <em>right-clicks</em> define the next polygon points. The
following figure shows a specific instant of this process.</p>
<div class="figure">
<img alt="../images/define_area1.gif" src="../images/define_area1.gif" />
<p class="caption">Defining polygon points with <em>right-clicks</em></p>
</div>
<p>When all polygon points are defined, you complete the polygon by
<em>Shift-right-click</em> anywhere on the map. Note that <em>Shift-right-click</em>
does not define a new polygon point; it just tells Greator that all
polygon points are now defined and that the area can be created. The
next figure shows the situation just after <em>Shift-right-click</em>:</p>
<div class="figure">
<img alt="../images/define_area2.gif" src="../images/define_area2.gif" />
<p class="caption">Completing the polygon with <em>Shift-right-click</em></p>
</div>
<p>The area has the name <em>Area-0</em>, which is a name automatically
generated by Greator. The name can be changed in the white edit-field
to the left of the map, as shown in Figure <a class="reference internal" href="#defining-cairo">Defining Cairo</a>. If you
edit in this field, make sure you press <em>Enter</em> when you're done,
otherwise Greator will not update the area name. Area names have to be
unique.</p>
</div>
<div class="section" id="neighbouring-areas">
<h2><a class="toc-backref" href="#id5">Neighbouring areas</a></h2>
<p>Areas with overlapping polygons are detected as neighbouring
areas. Greator will warn you when, during game play, you try to move
units between non-neighbouring areas. Therefore, it is important to
carfefully draw the polygons, so that neighbouring areas are correctly
detected.</p>
<p>In the area editor, the currently selected area has a yellow
polygon. The neighbouring areas have a white polygon. The following
picture shows an example of neighbouring areas:</p>
<div class="figure" id="cairo-yellow-and-its-neighbouring-areas-white">
<img alt="../images/cairo_neighbours.gif" src="../images/cairo_neighbours.gif" />
<p class="caption">Cairo (yellow) and its neighbouring areas (white)</p>
</div>
<p>Cairo is the currently selected area and, therefore, has a yellow
polygon. Its neighbouring areas have white polygons and they are named
<em>Northern Egypt</em>, <em>Sinai</em>, <em>SZ 46</em>, <em>SZ 47</em>, and <em>SZ 50</em> (its name is
not shown here, but it includes the Suez Canal). The other areas,
i.e., the non-neighbouring areas, have brown polygons. For instance,
<em>Western Egypt</em> and <em>Palestine</em> are not neighbouring <em>Cairo</em>.</p>
</div>
<div class="section" id="fine-adjustments-to-polygons">
<h2><a class="toc-backref" href="#id6">Fine adjustments to polygons</a></h2>
<p>In order to make fine adjustments to polygon points, each polygon has
one highlighted point. For the current area, the highlighted point is
yellow and red. For the other areas, the highlighted points are
white. An example can be seen in Figure <a class="reference internal" href="#cairo-yellow-and-its-neighbouring-areas-white">Cairo (yellow) and its
neighbouring areas (white)</a>.</p>
<p>The highlighted point can be any polygon point. To cycle through the
polygon points, use the <em>Control</em> key together with the <em>Page up</em> and
<em>Page down</em> keys.</p>
<blockquote>
<dl class="docutils">
<dt><em>C-Page Up</em></dt>
<dd>select next polygon point as highlighted point</dd>
<dt><em>C-Page Down</em></dt>
<dd>select previous polygon point as highlighted point</dd>
</dl>
</blockquote>
<p>The highlighted polygon point can be moved with using the <em>Control</em>
key together with the arrow keys.</p>
<blockquote>
<dl class="docutils">
<dt><em>C-Left Arrow</em></dt>
<dd>Move highlighted point left</dd>
<dt><em>C-Right Arrow</em></dt>
<dd>Move highlighted point right</dd>
<dt><em>C-Up Arrow</em></dt>
<dd>Move highlighted point up</dd>
<dt><em>C-Down Arrow</em></dt>
<dd>Move highlighted point down</dd>
</dl>
</blockquote>
<p><strong>Note</strong> It is also possible to drag the highlighted point with the left mouse
button.</p>
</div>
<div class="section" id="defining-unit-types">
<h2><a class="toc-backref" href="#id7">Defining unit types</a></h2>
<p>The next step is to define <em>unit types</em>. Unit types are prototypical
units. They do not appear on the board, but can be selected in order
to place actual units on the board.</p>
<p>A unit type consists of a name, an icon, and additional properties
that define the characteristice of the unit type. For instance, an
armour unit type would have the name <em>Armour</em> and it could have the
icon:</p>
<blockquote>
<img alt="../images/amr.png" src="../images/amr.png" />
</blockquote>
<p>Its attributes could be:</p>
<pre class="literal-block">
attack: 2
defend: 2
move:   2
cost:   7
terrain: land
</pre>
<p>You are free to define a different set of
attributes. Currently. Greator does not use the attributes at all. At
some point, Greator will be able to use the attributes to check, e.g.,
move validity.</p>
<p>To define a unit, select the <em>Setup editor</em> (<em>Game -- Edit Setup</em> or
<em>C-u</em>). Then click on the <em>New unit</em> button which is located in the
panel to the left of the map. This will pop-up the <a class="reference internal" href="#unit-type-editor">Unit type editor</a>:</p>
<div class="figure" id="unit-type-editor">
<img alt="../images/unit_type_editor.gif" src="../images/unit_type_editor.gif" />
<p class="caption">Unit type editor</p>
</div>
<p>At the top of the <em>Edit unit type</em> panel, you see a button and an
entry-field. The button has a black-dotted pattern. The entry-field
has the text &quot;New Unit Type&quot;. Below the button and the entry-field is
a larger entry field. At the bottom of the <em>Unit type editor</em>, a
<em>Delete</em>, <em>Ok</em>, and <em>Cancel</em> button are provided.</p>
<p>The unit icon is defined by clicking the black-dotted button at the
top of the <em>Edit unit type</em> panel. Clicking this button, pops-up a
file dialog which enables you to locate a <em>.xbm</em> file containing the
icon as a two-colour bitmap. The <em>bitmaps</em> directory in the root of
the Greator directory has some example unit bitmap files.</p>
<p>Click the black-dotted button, and use the file-dialog to locate and
select the file <em>bitmaps/amr.xbm</em>. Then click <em>Open</em> button of the
file dialog. The File dialog disappears and the black-dotted pattern
in the <em>Unit type editor</em> is replaced with an icon representing an
Armour unit.</p>
<p>The name of the unit should be entered in the entry field to the left
of the button. Replace &quot;New Unit Type&quot; by &quot;Armour&quot;.</p>
<p>The remaining unit type properties should be defined in the larger entry field. Click inside this field and enter the text:</p>
<pre class="literal-block">
attack: 2
defend: 2
move: 2
cost: 7
terrain: land
</pre>
<p>After this, the uit type is ready to be defined. The <em>Unit type editor</em> now looks like:</p>
<div class="figure" id="armour-unit-type">
<img alt="../images/armour_unit_type.gif" src="../images/armour_unit_type.gif" />
<p class="caption">Armour unit type</p>
</div>
<p>Click the <em>Ok</em> button to complete the unit type definition. The <em>Unit
type editor</em> disappears and the newly defined unit is put in the
<em>Available units</em> panel to the left of the map.</p>
</div>
<div class="section" id="updating-unit-types">
<h2><a class="toc-backref" href="#id8">Updating unit types</a></h2>
<p>To update an existing unit type, right-click the unit type button in
the <em>Available units</em> panel. The <em>Unit type editor</em> will show up
again, but instead of the default values for a new unit type, it shows
the name, icon, and properties of the selected unit type.</p>
<p>For instance, if we want to update the <em>Armour</em> unit type defined
earlier, we right-click its button. This will show the <em>Unit type
editor</em> as displayed in Figure <a class="reference internal" href="#armour-unit-type">Armour unit type</a>. You can now change
its name, icon, and properties as needed. After the changes are done,
click the <em>Ok</em> button to confirm the changes.</p>
<dl class="docutils">
<dt><strong>Note</strong> Changing a unit type does not change any units of that type</dt>
<dd>that were already places on the board.</dd>
</dl>
</div>
<div class="section" id="deleting-unit-types">
<h2><a class="toc-backref" href="#id9">Deleting unit types</a></h2>
<p>If you want to delete a unit type from the <em>Available units</em> panel,
right-click the unit type button. In the <em>Unit type editor</em>, click the
<em>Delete</em> button to the left of the <em>Ok</em> button. Now the unit type is
deleted.</p>
<p><strong>Note</strong> Greator does not ask for delete-confirmation; once you click
on the <em>Delete</em> button, the unit type is gone.</p>
<dl class="docutils">
<dt><strong>Note</strong> Deleting a unit type does not delete units of that type from</dt>
<dd>the board.</dd>
</dl>
</div>
</div>
<div class="section" id="what-is-in-a-game">
<h1><a class="toc-backref" href="#id10">What is in a game?</a></h1>
<p>In Greator, a game consists of</p>
<ul class="simple">
<li>a map (optional, but recommended)</li>
<li>areas</li>
<li>unit types</li>
<li>units</li>
<li>colours</li>
<li>players</li>
</ul>
<p>Games are stored in <em>game files</em>. Game files store all game
information, including image files for maps and/or bitmaps for unit
icons.</p>
<div class="section" id="the-map">
<h2><a class="toc-backref" href="#id11">The map</a></h2>
<p>A map is a <em>gif</em> image file. Gif image files usually have extension
<tt class="docutils literal">.gif</tt>.</p>
</div>
<div class="section" id="areas">
<h2><a class="toc-backref" href="#id12">Areas</a></h2>
<p>Areas are named regions on the map. The regions are defined by
polygons. You use Greator's <em>Area Editor</em> (C-a) to draw and name the areas
of your game.</p>
<p>Areas have <em>attributes</em>: properties of areas. Attributes are so-called
key-value pairs. The key is a name and the value is any sequence of characters.
For instance, in A&amp;A-like games, areas usually have an attribute &quot;IPC&quot; denoting
the value of the area. The IPC value is then represented by a number.</p>
<p>Some attributes are defined by Greator. Currently, these attributes are:</p>
<blockquote>
<ul class="simple">
<li>colour0: foreground colour</li>
<li>colour1: backgrund colour</li>
</ul>
</blockquote>
<p>The default values of these attributes are <em>black</em> and <em>grey</em>.</p>
</div>
<div class="section" id="unit-types">
<h2><a class="toc-backref" href="#id13">Unit types</a></h2>
<p>Unit types define the kinds of units players can use in the game. Unit
types have a name, an icon, colour, and as many user-defined
attributes as needed for the game.</p>
<p>The icon is a 2-colour bitmap (which usually have extension <tt class="docutils literal">.bmp</tt>).</p>
</div>
<div class="section" id="units">
<h2><a class="toc-backref" href="#id14">Units</a></h2>
<p>Units are instantiations of unit types that are placed on the board.</p>
</div>
<div class="section" id="colours">
<h2><a class="toc-backref" href="#id15">Colours</a></h2>
<p>In Greator, colours can be defined by the user. These colours always
come in pairs: foreground and background colours.</p>
</div>
<div class="section" id="players">
<h2><a class="toc-backref" href="#id16">Players</a></h2>
<p>Players have a name and can supply a password. If a password is
supplied, the player has to logon with the password, before he can
make changes to the game setup.</p>
</div>
</div>
</div>
</body>
</html>
